package com.demo.xj_plane.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.demo.xj_plane.dao.XjSelfObsMapper;
import com.demo.xj_plane.entity.XjSelfObsEntity;
import com.demo.xj_plane.service.XjSelfObsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class XjSelfObsServiceImpl  extends ServiceImpl<XjSelfObsMapper, XjSelfObsEntity> implements XjSelfObsService {
    @Autowired
    private XjSelfObsMapper xjSelfObsMapper;

    @Override
    public void saveObsBatch(List<XjSelfObsEntity> observations) {
        for(XjSelfObsEntity obs: observations ){
            xjSelfObsMapper.insert(obs);
        }
    }

    @Override
    public List<XjSelfObsEntity> selectLatestData(String cccc) {
        return xjSelfObsMapper.selectLatestData(cccc);
    }

    @Override
    public List<XjSelfObsEntity> selectLineData(String cccc, String curDate) {
        return xjSelfObsMapper.selectLineData(cccc, curDate);
    }

    @Override
    public List<XjSelfObsEntity> selectAllPlane(List<String> allXjPlaneList) {
        return xjSelfObsMapper.selectAllPlane(allXjPlaneList);
    }

    @Override
    public XjSelfObsEntity findPreviousData(String cccc, String pointCode, String dateTime) {
        return xjSelfObsMapper.findPreviousData(cccc, pointCode, dateTime);
    }

    @Override
    public XjSelfObsEntity selectFourGridsData(String cccc, String pointCode) {
        return xjSelfObsMapper.selectFourGridsData(cccc, pointCode);
    }
}
